package IC.Semantic;

/**
 * Semantic error class
 */
public class SemanticError extends Exception {
	
	private static final long serialVersionUID = -5465542816603310529L;
	private int line;
	private String value;
	
	public SemanticError(String message, int line, String value){
		super(message);
		this.line = line;
		this.value = value;
	}
	
	public SemanticError(String message, String value){
		super(message);
		this.line = -1;
		this.value = value;
	}

	public String toString(){
		return "Semantic error occured at line "+line+": "+this.getMessage()+": "+value;
	}
	
	/**
	 * set the error's line
	 */
	public void setLine(int line){
		this.line = line;
	}
}
